import React from "react";
import {Link} from 'react-router-dom';

import { Menu } from 'antd';

import './index.css';

export function MyMenu(props) {

    const {routes} = props;


    return (
        <>
            <Menu theme="light" mode="inline" defaultSelectedKeys={['1']} className="sider_menu">
            
            {
                routes.map(item => {

                    return (
                        
                        <Menu.Item icon={item.icon} key={item.id}>
                            <Link to={item.path} >
                            {item.title}
                            </Link>
                        </Menu.Item>
                        
                    )
                    
                })
            }
          </Menu>
        </>
    )
}